<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>访问属性</title>
    <script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
            $("img").click(function(){
                // 取值
                console.log($(this).attr("src"));
                console.log($(this).attr("alt"));
                console.log($(this).attr("title"));
                // 赋值
                $(this).attr("title","今天心情不错")
                $(this).attr("src","../images/1.gif")
            });
        })
    </script>
</head>
<body>
<img src="../images/heihei.gif" alt="图片加载失败" title="今天天气不错">
</body>
</html>